using System;
using System.Collections.Generic;
using System.Text;

namespace CodePlex.OpenSearch
{

    /// <summary>
    /// Represents one search result, usually part of a <see cref="SearchResponse"/> to specific search terms.
    /// </summary>
    public class SearchResult
    {
        private readonly string _id;
        private readonly DateTime _updated;
        private readonly string _title;
        private readonly string _link;
        private readonly string _description;


        /// <summary>
        /// Constructs a new <see cref="SearchResult"/>.
        /// </summary>
        public SearchResult( string link, string title, DateTime updated, string description)
            : this(link,link,title,updated,description)
        {

        }

        /// <summary>
        /// Constructs a new <see cref="SearchResult"/>.
        /// </summary>
        public SearchResult(string id, string link, string title, DateTime updated, string description)
        {
            _id = id;
            _updated = updated;
            _title = title;
            _link = link;
            _description = description;
        }

        /// <summary>
        /// Gets a unique identifier for this search result.
        /// </summary>
        public string ID
        {
            get
            {
                return _id;
            }
        }

        /// <summary>
        /// Gets the last time this search results was updated.
        /// </summary>
        public DateTime Updated
        {
            get
            {
                return _updated;
            }
        }

        /// <summary>
        /// Gets a short summary of this search result.
        /// </summary>
        public string Title
        {
            get
            {
                return _title;
            }
        }

        /// <summary>
        /// Gets a url for this search result.
        /// </summary>
        public string Link
        {
            get
            {
                return _link;
            }
        }

        /// <summary>
        /// Gets a longer description of this search result.
        /// </summary>
        public string Description
        {
            get
            {
                return _description;
            }
        }
    }
}
